import http from '@/utils/http'

const BASE_URL = '/cakerun/store-data'

export interface StoreDataResp {
  storeCity: string
  shopName: string
  totalCount: string
  merchantIncome: string
  cake4inchCount: string
  cake4inchIncome: string
  birthdayCakeCount: string
  birthdayCakeIncome: string
}

export interface StoreDataReq {
  statisticsDate: string
  accountIds?: string[]
}

export function fetchStoreData(query: StoreDataReq) {
  return http.get<StoreDataResp[]>(`${BASE_URL}/sales`, query)
}

export function exportStoreData(query: StoreDataReq) {
  return http.download(`${BASE_URL}/export`, query)
}
